package com.jinyang.jetpackdemo.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ArrayAdapter
import android.widget.ListView
import com.jinyang.jetpackdemo.R

class ViewActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_view)
        val lv1 = findViewById<ListView>(R.id.lv_one)
        val lv2 = findViewById<ListView>(R.id.lv_two)
        val strs1 = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12")
        val adapter1: ArrayAdapter<String> =
            ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, strs1)
        lv1.adapter = adapter1
        val strs2 = arrayOf("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L")
        val adapter2: ArrayAdapter<String> =
            ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, strs2)
        lv2.adapter = adapter2
    }
}